<?php
/**
 * Created by allen.qiang.
 * 会员等级活动
 * Date: 14-12-16
 * @author allen.qiang <allen.qiang@fistforward.com>
 * FUN-AC-0030
 */
quanli_require('module/func/eai.func.php');
quanli_require('module/base/goods/quanliGoods.class.php');
quanli_require('module/base/activity/activityConfig.class.php');//活动配置文件
quanli_include('module/base/promotion/quanliCoupon.class.php');//加载优惠券类

class ajax_member{

    public function execute() {

        if (isset($_REQUEST['operFlg']) && $_REQUEST['operFlg'] > 0) {

            switch($_REQUEST['operFlg']) {

                case 1://记录会员反馈信息
                    $this->record();
                    break;

            }

        } else {
            $this->toReturn('参数错误');

        }

    }
    public $activityNumber = 55000;//活动编号
    //会员反馈信息记录
    function  Record(){
        global $G_SHOP;
        $activityNumber=$this->activityNumber;
        //获取客户号
        if(in_array($_REQUEST['idear'],array(1,2,3,4))){
            $pcustID = $G_SHOP->currentPCustID;
            $activiy=new entity("activities_extend");
            $activiy->activityNumber=$activityNumber;
            $activiy->extend_6=$_REQUEST['idear'];
            $activiy->extend_7=$_REQUEST['val_text'];
            $activiy->extend_1=$pcustID;
            $G_SHOP->DBCA->save($activiy);
            $activity_sql="select count(1) as num from activities_extend where activityNumber=? and  extend_1=?";
            $activity_query=$G_SHOP->DBCA->stmt_query($activity_sql,'ss',$activityNumber,$pcustID);
            $infoArray=array(
                'num'=>$activity_query[0]->num,
                'mess'=>"提交成功",
            );
            returnJsonData($infoArray, 200);
        }else{
            returnJsonData("参数错误", 400);
        }


    }





}